<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <title>管理员REBORT后台</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='plugins/bootstrap/css/bootstrap.min.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='plugins/iCheck/square/blue.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='plugins/pace/pace.min.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='plugins/adminlte/css/AdminLTE.min.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='plugins/adminlte/css/skins/skin-blue.min.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/global.css') }}">
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <style>
        /* 全局样式 */
        body {
      /* 替换为您的图片URL，确保图片路径正确 */
      background-image: url("{{ url_for('static', filename='images/rebort.jpg') }}");
      background-size: cover; /* 图片覆盖全屏 */
      background-position: center; /* 图片居中 */
      background-repeat: no-repeat; /* 不重复平铺 */
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      font-family: 'Segoe UI', 'Roboto', sans-serif;
      padding: 20px;
      /* 如果图片较亮，可添加半透明遮罩增加文字可读性 */
      position: relative;
    }

    /* 添加半透明遮罩（可选） */
    body::before {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(255, 255, 255, 0.3); /* 白色遮罩，透明度80% */
      z-index: -1; /* 确保遮罩在内容下方 */
    }

        /* 登录框容器 */
        .login-container {
            width: 100%;
            max-width: 420px;
            perspective: 1000px;
        }

        /* 登录卡片 */
        .login-card {
            background: #ffffff;
            border-radius: 12px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
            overflow: hidden;
            transition: all 0.3s ease;
            transform-style: preserve-3d;
            transform: translateY(0);
        }

        .login-card:hover {
            box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
            transform: translateY(-5px);
        }

        /* 登录头部 */
        .login-header {
            background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
            color: white;
            padding: 25px;
            text-align: center;
            position: relative;
            overflow: hidden;
        }

        .login-header h1 {
            font-size: 24px;
            font-weight: 600;
            margin: 0;
            position: relative;
            z-index: 2;
        }

        .login-header::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(255, 255, 255, 0.1);
            transform: skewY(-3deg);
            transform-origin: top right;
            z-index: 1;
        }

        /* 登录主体 */
        .login-body {
            padding: 30px;
        }

        .login-message {
            color: #666;
            margin-bottom: 25px;
            text-align: center;
            font-size: 15px;
        }

        /* 表单样式 */
        .form-group {
            margin-bottom: 20px;
            position: relative;
        }

        .form-control {
            height: 50px;
            padding: 10px 15px 10px 45px;
            border: 1px solid #e1e5eb;
            border-radius: 8px;
            font-size: 15px;
            transition: all 0.3s ease;
            box-shadow: none !important;
        }

        .form-control:focus {
            border-color: #3498db;
            box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15) !important;
        }

        .form-control-icon {
            position: absolute;
            left: 15px;
            top: 50%;
            transform: translateY(-50%);
            color: #a0a6ac;
            font-size: 18px;
        }

        /* 提醒消息 */
        .alert {
            border-radius: 8px;
            margin-bottom: 20px;
            padding: 12px 15px;
            font-size: 14px;
            animation: fadeIn 0.3s ease;
        }

        /* 记住我 */
        .remember-me {
            display: flex;
            align-items: center;
            margin-bottom: 20px;
        }

        .remember-me input {
            margin-right: 8px;
        }

        .remember-me label {
            color: #555;
            font-size: 14px;
            cursor: pointer;
        }

        /* 按钮样式 */
        .btn-primary {
            background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
            border: none;
            border-radius: 8px;
            height: 50px;
            font-size: 16px;
            font-weight: 500;
            transition: all 0.3s ease;
            box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
        }

        .btn-primary:hover, .btn-primary:focus {
            background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
            transform: translateY(-2px);
            box-shadow: 0 6px 15px rgba(52, 152, 219, 0.35);
        }

        .btn-primary:active {
            transform: translateY(0);
        }

        /* iCheck 样式调整 */
        .icheckbox_square-blue {
            margin-top: -2px;
        }

        .icheckbox_square-blue.checked {
            background-color: #3498db;
            border-color: #3498db;
        }

        .icheckbox_square-blue.checked::after {
            border-color: white;
        }

        /* 加载动画 */
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* 响应式调整 */
        @media (max-width: 576px) {
            .login-body {
                padding: 25px 20px;
            }

            .form-control, .btn-primary {
                height: 46px;
            }
        }
    </style>
    <!--[if lt IE 9]>
    <script src="plugins/html5shiv.min.js"></script>
    <script src="plugins/respond.min.js"></script>
    <![endif]-->
</head>
<body>
    <div class="login-container">
        <div class="login-card">
            <div class="login-header">
                <h1>使用管理员密码登录</h1>
            </div>
            <div class="login-body">
                <p class="login-message">请输入管理员帐户及密码</p>
                <form method="post">
                    {{form.hidden_tag()}}

                    <div class="form-group">
                        <i class="fa fa-user form-control-icon"></i>
                        {{form.username(class_="form-control",placeholder="用户名")}}
                    </div>

                    <div class="form-group">
                        <i class="fa fa-lock form-control-icon"></i>
                        {{form.password(class_="form-control",placeholder="密码")}}
                    </div>

                    {% for message in get_flashed_messages() %}
                    <div class="alert alert-warning">
                        <button type="button" class="close" data-dismiss="alert">&times;</button>
                        {{ message }}
                    </div>
                    {% endfor %}

                    <div class="remember-me">
                        <div class="checkbox icheck">
                            <label>
                                {{form.rememberme()}}{{form.rememberme.label}}
                            </label>
                        </div>
                    </div>

                    {{form.submit(class_="btn btn-primary btn-block")}}
                </form>
            </div>
        </div>
    </div>

    <script src="{{ url_for('static', filename='plugins/jQuery/jquery-2.2.3.min.js') }}"></script>
    <script src="{{ url_for('static', filename='plugins/bootstrap/js/bootstrap.min.js') }}"></script>
    <script src="{{ url_for('static', filename='plugins/iCheck/icheck.min.js') }}"></script>
    <script src="{{ url_for('static', filename='plugins/pace/pace.min.js') }}"></script>
    <script src="{{ url_for('static', filename='js/global.js') }}"></script>
    <script>
        function initPage() {
            // 初始化iCheck插件
            $('input').iCheck({
                checkboxClass: 'icheckbox_square-blue',
                radioClass: 'iradio_square-blue',
                increaseArea: '20%'
            });

            // 表单字段聚焦效果
            $('.form-control').on('focus', function() {
                $(this).parent().find('.form-control-icon').css('color', '#3498db');
            }).on('blur', function() {
                $(this).parent().find('.form-control-icon').css('color', '#a0a6ac');
            });

            // 添加页面载入动画
            Pace.on('done', function() {
                $('.login-card').addClass('loaded');
            });
        }
    </script>
</body>
</html>
